package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.SysRoleUserService;
import com.atguigu.spzx.model.dto.system.AssginRoleDto;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @ClassName: SysRoleUserController
 * @Package: com.atguigu.spzx.manager.controller
 * @Description 用户管理分配角色
 * @Author 孤妤
 * @Date: 2023/12/5 19:01
 */
@RestController
@RequestMapping("/admin/system/sysRoleUser")
@Tag(name = "用户分配角色")
public class SysRoleUserController {
    @Autowired
    private SysRoleUserService sysRoleUserService;
    @PostMapping("/doAssign")
    @Operation(summary = "分配角色给用户")
    public Result doAssign(@RequestBody AssginRoleDto assginRoleDto){
        sysRoleUserService.doAssign(assginRoleDto);
        return Result.build(null, ResultCodeEnum.SUCCESS).setMsg("角色分配成功");
    }
}
